構築、破棄、コピー

空のコンテナー・コンストラクター

concurrent_unordered_set(); explicit concurrent_unordered_set( const allocator_type& alloc );

空の concurrent_unordered_set を構築。バケットの初期数は未指定です。

利用可能であれば、アロケーター alloc を使用してメモリーを割り当てます。


explicit concurrent_unordered_set( size_type bucket_count, 
                                   const hasher& hash = hasher(), 
                                   const key_equal& equal = key_equal(), 
                                   const allocator_type& alloc = allocator_type() ); 

concurrent_unordered_set( size_type bucket_count, const allocator_type& alloc ); 

concurrent_unordered_set( size_type bucket_count, const hasher& hash, 
                          const allocator_type& alloc );

事前割り当てされた bucket_count 個のバケットを使用して、空の concurrent_unordered_set を作成します。

可能であれば、ハッシュ関数 hasher、プレディケート equal を使用して、key_type オブジェクトが等しいかどうかを比較してアロケーター alloc でメモリーを割り当てます。

要素のシーケンスから構築

template <typename InputIterator> 
concurrent_unordered_set( InputIterator first, InputIterator last, 
                          size_type bucket_count = /*implementation-defined*/, 
                          const hasher& hash = hasher(), 
                          const key_equal& equal = key_equal(), 
                          const allocator_type& alloc = allocator_type() ); 

template <typename Inputiterator> 
concurrent_unordered_set( InputIterator first, InputIterator last, 
                          size_type bucket_count, const allocator_type& alloc ); 

template <typename InputIterator> 
concurrent_unordered_set( InputIterator first, InputIterator last, 
                          size_type bucket_count, const hasher& hash, 
                          const allocator_type& alloc );

半開区間 [first, last) のすべての要素を含む concurrent_unordered_set を作成します。

半開区間 [first, last) に複数の同等の要素が含まれている場合、どの要素が挿入されるかは未指定です。

可能であれば、ハッシュ関数 hasher、プレディケート equal を使用して、key_type オブジェクトが等しいかどうかを比較してアロケーター alloc でメモリーを割り当てます。

要件: InputIterator タイプは、[input.iterators] ISO C++ 標準の InputIterator 要件を満たしている必要があります。


concurrent_unordered_set( std::initializer_list<value_type> init, 
                          size_type bucket_count = /*implementation-defined*/, 
                          const hasher& hash = hasher(), 
                          const key_equal& equal = key_equal(), 
                          const allocator_type& alloc = allocator_type() );

concurrent_unordered_set(init.begin(), init.end(), bucket_count, hash, equal, alloc) と等価です。


concurrent_unordered_set( std::initializer_list<value_type> init, 
                          size_type bucket_count, const allocator_type& alloc );

concurrent_unordered_set(init.begin(), init.end(), bucket_count, alloc) と等価です。


concurrent_unordered_set( std::initializer_list<value_type> init, 
                          size_type bucket_count, const hasher& hash, 
                          const allocator_type& alloc );

concurrent_unordered_set(init.begin(), init.end(), bucket_count, hash, alloc) と等価です。

コンストラクターをコピー

concurrent_unordered_set( const concurrent_unordered_set& other ); 

concurrent_unordered_set( const concurrent_unordered_set& other, 
                          const allocator_type& alloc );

other のコピーを作成します。

アロケーター引数が指定されていない場合、std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()) を呼び出して取得できます。

other との同時操作が行われると動作は未定義です。

ムーブ・コンストラクター

concurrent_unordered_set( concurrent_unordered_set&& other ); 

concurrent_unordered_set( concurrent_unordered_set&& other, 
                          const allocator_type& alloc );

ムーブ・セマンティクスを使用して、other の内容で concurrent_unordered_set を作成します。

other は有効のままですが、未指定の状態となります。

アロケーター引数が指定されていない場合、std::move(other.get_allocator()) を呼び出して取得できます。

other との同時操作が行われると動作は未定義です。

デストラクター

~concurrent_unordered_set();

concurrent_unordered_set を破棄します。ストアされた要素のデストラクターを呼び出してストレージの割り当てを解除します。

*this との同時操作が行われると動作は未定義です。

代入操作

concurrent_unordered_set& operator=( const concurrent_unordered_set& other );

*this のすべての要素を other の要素をコピーして置き換えます。

std::allocator_traits<allocator_type>::propagate_on_container_copy_assignment::valuetrue の場合、アロケーターのコピーを割り当てます。

*thisother の同時操作が行われると動作は未定義です。

戻り値: *this への参照を返します。


concurrent_unordered_set& operator=( concurrent_unordered_set&& other ) noexcept(/*See below*/);

*this のすべての要素を、ムーブ・セマンティクスによって other の要素で置き換えます。

other は有効のままですが、未指定の状態となります。

std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::valuetrue の場合、アロケーターの要素を移動して割り当てます。

*thisother の同時操作が行われると動作は未定義です。

戻り値: *this への参照を返します。

例外: 具体的に noexcept は以下です。

noexcept(std::allocator_traits<allocator_type>::is_always_equal::value && 
         std::is_nothrow_move_assignable<hasher>::value && 
         std::is_nothrow_move_assignable<key_equal>::value)

concurrent_unordered_set& operator=( std::initializer_list<value_type> init );

*this のすべての要素を init の要素して置き換えます。

init に複数の同等の要素が含まれている場合、どの要素が挿入されるかは未指定です。

*this との同時操作が行われると動作は未定義です。

戻り値: *this への参照を返します。